// TexturesDlg.cpp : implementation file
//

#include "stdafx.h"
#include "test.h"
#include "TexturesDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTexturesDlg dialog


CTexturesDlg::CTexturesDlg(std::deque<TextureName> & list,CWnd* pParent /*=NULL*/)
: CDialog(CTexturesDlg::IDD, pParent),textures(list)
{
	//{{AFX_DATA_INIT(CTexturesDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	selected=-1;
}


void CTexturesDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTexturesDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTexturesDlg, CDialog)
	//{{AFX_MSG_MAP(CTexturesDlg)
	ON_CBN_EDITCHANGE(IDC_COMBO1, OnEditchangeCombo1)
	ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTexturesDlg message handlers

BOOL CTexturesDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	char numero[10];
	
	CComboBox * combo= (CComboBox *)GetDlgItem(IDC_COMBO1);
	for(int i=0;i<textures.size();i++){
		itoa(i,numero,10);
		combo->AddString(CString("Textura ")+textures[i].name);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CTexturesDlg::OnEditchangeCombo1() 
{
	CComboBox * combo= (CComboBox *)GetDlgItem(IDC_COMBO1);
	selected=combo->GetCurSel();
	
}

void CTexturesDlg::OnSelchangeCombo1() 
{
	CComboBox * combo= (CComboBox *)GetDlgItem(IDC_COMBO1);
	selected=combo->GetCurSel();
}
